From Cppreference
|
|
|
|
|
|
|
| template< class T, T v >
struct integral_constant;
|
| (C++11 feature)
|
|
|
|
std::integral_constant wraps a static constant of specified type. It is the base class for the C++ type traits.
[edit] Member types
|
|
| Type
| Definition
|
|
|
| value_type
| T
|
|
|
| type
| std::integral_constant<T,v>
|
[edit] Member constants
|
|
| Name
| Value
|
|
|
| value
| static constant expression of type T with value v
|
[edit] Member functions
|
|
| operator value_type
| converts the object to value_type, returns value (public member function)
|
[edit] Equivalent definition
template< class T, T v >
struct integral_constant
{
static constexpr T value = v;
typedef T value_type;
typedef integral_constant type;
constexpr operator value_type() const {return value;}
};
|
[edit] Example
[edit] See also
|
|
|
| boolean instantiations of integral_constant (class)
|